import request from '@/utils/http'

const login = async ({ username, password }) => {
  const result = await request({
    url: '/user/login',
    method: 'POST',
    data: {
      username,
      password,
    },
  })

  return result
}

const register = async ({ username, password, name, sign }) => {
  const result = await request({
    url: '/user/add',
    method: 'POST',
    data: {
      username,
      password,
      name,
      sign,
    },
  })

  return result
}

export { login, register }
